<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

  <head>
    {% if show_results %}
    <title>C60 - {% for stop in stops %}{{stop.stop}} {% endfor %}</title>
    {% else %}
    <title>C60</title>
    {% endif %}
  </head>
  <body>
    {% if error %}
        <span style="background:#f88;">{{error}}</span>
    {% endif %}
    {% if show_results %}
    {% for stop in stops %}
        {% if stop.error %}
            <span style="background:#88f;">
                <b>{{stop.stop}}</b>&nbsp;{{stop.name|default:""}}
            </span>
            <br/>
            <span style="color:red;">{{stop.error}}</span>
        {% else %}
            <span style="background:#88f;">
                <b>{{stop.stop}}</b>&nbsp;{{stop.name}}
            </span>
<pre>{% for v in stop.vehicles %}<b>{{v.0|stringformat:"-4s"}}</b> {{v.1|date:"H:i"}} ({{v.2}})
{% endfor %}</pre>
        {% endif %}
        <hr/>
    {% endfor %}
    <span style="background:#8f8;">{{now|date:"H:i d-M-y"}}</span>
    {% endif %}
    
<form method="get" action="/req">
<p>
stop: <input type="text" name="s"{% if field_stop %} value="{{field_stop}}"{% endif %} /><br/>
line: <input type="text" name="l"{% if field_line %} value="{{field_line}}"{% endif %} /><br/>
<input type="submit" value="Submit"/><br/>
next {% if field_time %}{% ifnotequal field_time "60" %}{{field_time}} minutes{% else %}hour{% endifnotequal %}{% else %}hour{% endif %} only:
<input type="checkbox" name="t" value='{{field_time|default:"60"}}'{% if field_time %} checked="checked"{% endif %} />
</p>
</form>
</body>
</html>
